home *** CD-ROM | disk | FTP | other *** search
/ Visual FX for Image FX / VisualFX for Image FX 3.adf / Files / ARexx / 03 / 17.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  1997-08-07  |  3.7 KB  |  198 lines

  1. /*
  2.                           Visual FX Arexx Script
  3.                            Written By J.L. White
  4.                          (C)1997 Merlin's Software
  5. */
  6.  
  7. Options Results
  8. address "IMAGEFX.1"
  9. ScreenToFront
  10. Undo Off
  11. if exists("libs:flyer.library") then do
  12.     TOASTERLIB="ToasterARexx.port"
  13.     call remlib('ToasterARexx.port')
  14.     call remlib('PROJECT_REXX_PORT')
  15.     call addlib('PROJECT_REXX_PORT' , 0)
  16.     call addlib(TOASTERLIB,0)
  17.     end
  18. call Settings()
  19. call open TempFile,"VFXIFX:TempDrawer/"FXNum".txt",R
  20. line = readln(TempFile)
  21. PicAName = strip(line)
  22. line = readln(TempFile)
  23. Start = strip(line)
  24. line = readln(TempFile)
  25. End = strip(line)
  26. line = readln(TempFile)
  27. IAType = strip(line)
  28. line = readln(TempFile)
  29. PicBName = strip(line)
  30. line = readln(TempFile)
  31. StartB = strip(line)
  32. line = readln(TempFile)
  33. EndB = strip(line)
  34. line = readln(TempFile)
  35. IBType = strip(line)
  36. line = readln(TempFile)
  37. BGName = strip(line)
  38.  
  39. call close TempFile
  40.  
  41. Frames = (End - Start)+1
  42. j=0
  43. k=0
  44. TFrames = Frames
  45. TNum = 3
  46. if TFrames > 999 then TNum = 4
  47. if TFrames > 9999 then TNum = 5
  48. if Field = 1 then TFrames = Frames*2
  49. do i = Start to End
  50.     k = k + 1
  51.     call open TempFile,"RAM:VFXNums",W
  52.     call writeln TempFile,right(k,5,'0')
  53.     call writeln TempFile,right(Frames,5,'0')
  54.     call close TempFile
  55.     f=0
  56.     Redraw Off
  57.     j = j+ 1
  58.     call DoIt()
  59.     Redraw On
  60.     call SaveIt()
  61.         if Field = 1 then do
  62.             Redraw Off
  63.             j = j + 1
  64.             call DoIt()
  65.             Redraw On
  66.             call SaveIt()
  67.             end 
  68.     end
  69.     Undo On
  70. exit
  71.  
  72.  
  73. LoadA:
  74.     if (POS('FLY_1',SHOW('Ports')) = 0) then do
  75.         Undo On
  76.         exit
  77.         end
  78.     if IAType = 0 then do
  79.         LoadBuffer PicAName Force i
  80.         end
  81.     if IAType = 1 then do
  82.         LoadBuffer PicAName Force 1
  83.         end
  84.     if IAType = 2 then do
  85.         LoadBuffer PicAName Force
  86.         end
  87.     if IAType = 3 then do
  88.         LoadBuffer PicAName""right(i,TNum,'0') Force
  89.         end
  90. return
  91.  
  92. LoadB:
  93.     if (POS('FLY_1',SHOW('Ports')) = 0) then do
  94.         Undo On
  95.         exit
  96.         end
  97.     if IBType = 0 then do
  98.         LoadBuffer PicBName Force (k+StartB)-1
  99.         end
  100.     if IBType = 1 then do
  101.         LoadBuffer PicBName Force 1
  102.         end
  103.     if IBType = 2 then do
  104.         LoadBuffer PicBName Force
  105.         end
  106.     if IBType = 3 then do
  107.         LoadBuffer PicBName""right((k+StartB)-1,TNum,'0') Force
  108.         end
  109.     if IBType = 4 then do
  110.         ActiveColor PicBName
  111.         FilledBox 0 0 Width Height
  112.         ActiveColor 1
  113.         end
  114. return
  115.  
  116.  
  117.  
  118. SaveIt:
  119.     if (POS('FLY_1',SHOW('Ports')) = 0) then do
  120.         Undo On
  121.         exit
  122.         end
  123.     if SaveType = 0 then do
  124.         call Switcher(TOSW)
  125.         call Switcher(MDV1)
  126.  
  127.         Render Go
  128.         if Field = 1 then
  129.                 call RecordAdd(SaveName,1,6,Compression)
  130.         else
  131.                 call RecordAdd(SaveName,2,6,Compression)
  132.         if j = TFrames then
  133.             call MakeIcon(SaveName,(Frames-10))
  134.         end
  135.  
  136.     if SaveType = 1 then do
  137.         if Field = 1 then do
  138.             f= f + 1
  139.             if f = 1 then
  140.                 SaveBufferAs ILBM "VFXIFX:TempDrawer/PicA"
  141.             if f = 2 then do
  142.                 GetMain
  143.                 parse var result Name Width Height Blah
  144.                 Scale Width Height/2
  145.                 Swap
  146.                 LoadBuffer "VFXIFX:TempDrawer/PicA" Force
  147.                 Scale Width Height/2
  148.                 Hook Interlace
  149.                 SaveBufferAs ILBM SaveName""right(k,TNum,'0')
  150.                 f = 0
  151.                 end
  152.             end
  153.         else do
  154.             SaveBufferAs ILBM SaveName""right(k,TNum,'0')
  155.             end    
  156.         end
  157.  
  158. return
  159.  
  160.  
  161.  
  162.  
  163. DoIt:
  164.     if (POS('FLY_1',SHOW('Ports')) = 0) then do
  165.         Undo On
  166.         exit
  167.         end
  168.     if j = 1 then do
  169.         call LoadA()
  170.         GetMain
  171.         parse var result Name Width Height Blah
  172.         end
  173.  
  174.     call LoadB()
  175.     Swap
  176.     LoadBuffer BGName Force
  177.     Scale Width Height
  178.     call open TempFile,"ENV:ImageFX/CineMatteColor",W
  179.     call writeln TempFile,1
  180.     call close TempFile
  181.     Hook CineMatte GreenScreen OutputBoth 1 0 0 0 0 0 0 0 0 255
  182.     Swap
  183.     call LoadA()
  184.     Swap
  185.     call open TempFile,"ENV:ImageFX/CineMatteColor",W
  186.     call writeln TempFile,0
  187.     call close TempFile
  188.     Hook CineMatte BlueScreen OutputBoth 1 0 0 0 0 0 0 0 0 255
  189.     call open TempFile,"ENV:ImageFX/CineMatteColor",W
  190.     call writeln TempFile,1
  191.     call close TempFile
  192.  
  193.     DrawMode Normal
  194.     ActiveColor 1
  195.  
  196. return
  197.  
  198.